<%@ page import="com.dingpeikeji.quickdeer.modules.rentproduct.entity.TDemands" contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<c:set var="REACTSTATUS_WAIT" value="<%=TDemands.REACTSTATUS_WAIT %>" />
<c:set var="REACTSTATUS_DONE" value="<%=TDemands.REACTSTATUS_DONE %>" />
<c:set var="REACTSTATUS_SURE" value="<%=TDemands.REACTSTATUS_SURE %>" />
<c:set var="REACTSTATUS_CANCEL" value="<%=TDemands.REACTSTATUS_CANCEL %>" />
<html>
<head>
	<title>用户需求管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
			return false;
		}
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/rentproduct/tDemands/">需求列表</a></li>
		<shiro:hasPermission name="rentproduct:tDemands:edit"><li><a href="${ctx}/rentproduct/tDemands/form">需求添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="tDemands" action="${ctx}/rentproduct/tDemands/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<div>
			<label>起始日期：</label>
			<input name="fromdate" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
				value="<fmt:formatDate value="${tDemands.fromdate}" pattern="yyyy-MM-dd"/>"
				onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
			至
			<input name="stopdate" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
				value="<fmt:formatDate value="${tDemands.fromdate}" pattern="yyyy-MM-dd"/>"
				onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
			<label>反馈状态：</label>
			<select name="reactstatus" class="input-mini">
				<option value="">全部</option>
				<option value="${REACTSTATUS_WAIT }" ${tDemands.reactstatus==REACTSTATUS_WAIT?'selected':'' }>待响应</option>
				<option value="${REACTSTATUS_SURE }" ${tDemands.reactstatus==REACTSTATUS_SURE?'selected':'' }>已响应</option>
				<option value="${REACTSTATUS_DONE }" ${tDemands.reactstatus==REACTSTATUS_DONE?'selected':'' }>已支付</option>
				<option value="${REACTSTATUS_CANCEL }" ${tDemands.reactstatus==REACTSTATUS_CANCEL?'selected':'' }>已取消</option>
			</select>
			<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
		</div>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>需求日期</th>
				<th>车型描述</th>
				<th>座位数</th>
				<th>租赁数量</th>
				<th>租赁开始日期</th>
				<th>租赁天数</th>
				<th>出发城市</th>
				<th>目的城市</th>
				<th>期望价格</th>
				<th>反馈状态</th>
				<shiro:hasPermission name="rentproduct:tDemands:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="tDemands">
			<tr>
				<td>
					<fmt:formatDate value="${tDemands.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					${tDemands.modeldesc}
				</td>
				<td>
					${tDemands.seats}
				</td>
				<td>
					${tDemands.vehiclenum}
				</td>
				<td>
					<fmt:formatDate value="${tDemands.fromdate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					${tDemands.rentdays}
				</td>
				<td>
					${tDemands.departcity.sitename}
				</td>
				<td>
					${tDemands.destcity.sitename}
				</td>
				<td>
					${tDemands.hopeprice}
				</td>
				<td>
					${tDemands.reactstatus==REACTSTATUS_WAIT?'待反馈':'' }
					${tDemands.reactstatus==REACTSTATUS_DONE?'已反馈':'' }
					${tDemands.reactstatus==REACTSTATUS_SURE?'已确定':'' }
				</td>
				<shiro:hasPermission name="rentproduct:tDemands:edit">
					<td style="${tDemands.reactstatus==REACTSTATUS_SURE?'background-color:#FCF8E3;':'' }">
						<c:if test="${tDemands.reactstatus==REACTSTATUS_WAIT }">
							<a href="${ctx}/rentproduct/tDemands/form?demandid=${tDemands.demandid}">修改</a>
							<a href="${ctx}/rentproduct/tDemands/delete?demandid=${tDemands.demandid}" onclick="return confirmx('确认要删除该用户需求吗？', this.href)">删除</a>
						</c:if>
						<c:if test="${tDemands.reactstatus==REACTSTATUS_DONE }">
							<a href="${ctx}/rentproduct/tDemands/sure?demandid=${tDemands.demandid}">确定</a>
						</c:if>
					</td>
				</shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>